//
//  JSTechProtocol.h
//  JSTech
//
//  Created by 高得华 on 2019/4/23.
//  Copyright © 2020 华&梅. All rights reserved.
//

#import <Foundation/Foundation.h>
/*#import "MDHMacro.h"
#import "MDHHTTPService.h"
@class MDHViewModel;
*/
NS_ASSUME_NONNULL_BEGIN

@interface MDHPTProtocol : NSObject

@end

NS_ASSUME_NONNULL_END

//MARK: - ==== 协议的方法进行做
@protocol MMWDHObserveNavBackButtonHandlerProtocol <NSObject>
@optional
///重写下面的方法以拦截导航栏返回按钮点击事件，返回 YES 则 pop，NO 则不 pop
- (BOOL)navigationShouldPopOnBackButton;
@end


/// A protocol which is adopted by views which are backed by view models.
@protocol MDHReactiveView <NSObject>
/// Binds the given view model to the view.
///
/// viewModel - The view model
- (void)bindViewModel:(id)viewModel;
@end


/*
//MARK: - ===== 关于导航栏跳转（Push/Pop   Present/Dismiss）的协议
@protocol MDHPTNavigationProtocol <NSObject>

/// Pushes the corresponding view controller.
///
/// Uses a horizontal slide transition.
/// Has no effect if the corresponding view controller is already in the stack.
///
/// viewModel - the view model
/// animated  - use animation or not
- (void)pushViewModel:(MDHViewModel *)viewModel animated:(BOOL)animated;

/// Pops the top view controller in the stack.
///
/// animated - use animation or not
- (void)popViewModelAnimated:(BOOL)animated;

/// Pops until there's only a single view controller left on the stack.
///
/// animated - use animation or not
- (void)popToRootViewModelAnimated:(BOOL)animated;

/// Present the corresponding view controller.
///
/// viewModel  - the view model
/// animated   - use animation or not
/// completion - the completion handler
- (void)presentViewModel:(MDHViewModel *)viewModel animated:(BOOL)animated completion:(VoidBlock)completion;

/// Dismiss the presented view controller.
///
/// animated   - use animation or not
/// completion - the completion handler
- (void)dismissViewModelAnimated:(BOOL)animated completion:(VoidBlock)completion;

/// Reset the corresponding view controller as the root view controller of the application's window.
///
/// viewModel - the view model
- (void)resetRootViewModel:(MDHViewModel *)viewModel;

@end


@protocol MDHViewModelServices <NSObject, MDHPTNavigationProtocol>
/// A reference to MHHTTPService instance.
/// 全局通过这个Client来请求数据，处理用户信息
@property (nonatomic, readonly, strong) MDHHTTPService * _Nullable client;
@end

*/
